home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Crack It!
/
Crack It!.iso
/
CUTTER.SCP
< prev
next >
Wrap
Text File
|
1998-04-16
|
25KB
|
856 lines
***
*Crack-It Launcher - Script Version 0.30
*Authors T. K. Tierney, A. Fauteux.
*
*Kludges: Call problems.
*
Debug all
Version Cutter,0.126
*Constants
set MAX640NOSCALE,77
set MAX800NOSCALE,88
set MAX640SCALE,123
set MAX800SCALE,155
*Initial setup - Preload the the main slist, theme and phrase systems.
readfile MainList, content\mainlist.sl, slist
gosub shInitTheme
gosub shInitPhrase
*Play the opening video.
player 1,play,avi,video\aztechmv.avi
:AviLoop
player 1,check
if @$STATUS eq PLAY goto AviLoop
**
*Display the Title Page.
*
:TitleDisplay
openhtml 1,100%,95%,0%,0%
concat Title800Adjust,"<center><big>Welcome To CRACK IT</big>
&<br><a href=^"exit:?TitleGifClick^">Next</a></center><br>"
if @$ScreenWidth eq 640 clear Title800Adjust
concat x,
&"<body background=^"art\bkgnd.gif^">
&<br>",@Title800Adjust,
&"<center><a href=^"exit:?TitleGifClick^"><img src=^"art\welcome.gif^"></a>
&</center></body>"
dohtml 1,Crack-It Title Page,@x,titlekill,1
gosub shTheme
dohtml 1,Crack-It Title Page,@x,titlekill,30
goto WelcomeDisplay
:TitleGifClick
goto WelcomeDisplay
:TitleKill
gosub shPhrase
gosub Quitter
goto TitleDisplay
**
*Display the Welcome page.
*
:WelcomeDisplay
set Welcome800Adjust,<br><br><br>
if @$ScreenWidth eq 640 clear Welcome800Adjust
:WelcomeReDisplay
concat x,
&"<body background="art\bkgnd.gif">
&<a href="exit:?WelcomeQuitClick">Quit Crack-It </a>^|
&<a href="exit:?WelcomeKillMusicClick"> Kill the Music!</a>^
&<br><br><br><br>",@Welcome800Adjust,
&"<center><img src=^"art\Splash.gif^" usemap=^"#splashMap^">
&<MAP NAME=^"splashMap">
&<AREA COORDS=^"11^,237^,147^,271^" HREF=^"exit:?AboutPageClick^">
&<AREA COORDS=^"154^,232^,296^,275^" HREF=^"exit:?SelectionPageClick^">
&<AREA COORDS=^"305^,234^,444^,276^" HREF=^"exit:?DemoPageClick^">
&<AREA COORDS=^"453^,236^,590^,269^" HREF=^"exit:?CatalogButtonClick^">
&</map></body>"
dohtml 1,Crack-It Welcome Page, @x,welcomekill,1
gosub shTheme
dohtml 1,Crack-It Welcome Page, @x,welcomekill
goto SelectionDisplay
:WelcomeKillMusicClick
gosub shPhrase
set shThemeEnable,FALSE
goto WelcomeReDisplay
:WelcomeQuitClick
:WelcomeKill
gosub shPhrase
gosub Quitter
goto WelcomeReDisplay
:ABoutPageClick
gosub shPhrase
goto AboutDisplay
:CatalogButtonClick
gosub shPhrase
execute catalog\aztech.exe,,catalog
goto WelcomeDisplay
:SelectionPageClick
gosub shPhrase
goto SelectionDisplay
:DemoPageClick
gosub shPhrase
goto Demodisplay
**
*Display the About page.
*
:AboutDisplay
gosub shTheme
concat x,<body background="art\bkgnd.gif"><a href="exit:?AboutBackClick">Go back</a>
&<br><center><img src="art\about.gif"></center><br></body>
doHTML 1,About Crack-It!,@x,AboutKill
:AboutKill
gosub shPhrase
gosub Quitter
goto AboutDisplay
:AboutBackClick
gosub shPhrase
goto WelcomeDisplay
**
*Display the Demo page.
*
*Re-display the page with any data from the previous display.
:DemoDisplay
:DemoRedisplay
gosub shTheme
concat x,
&<body background="art\bkgnd.gif">
&<TABLE BORDER="0" COLS="2">
&<TR><TD WIDTH="107"><a href="exit:?WelcomeDisplay">Go back</a></TD>
&<TD>Click on one of these Buttons to install a demo.</TD>
&</TR></TABLE>,
&<center><img src=^"art\demo.gif^" usemap=^"#demomap^"></center>,
&<MAP NAME=^"demomap^">
&<AREA COORDS=^"18^,52^,319^,147^" HREF=^"exit:?DemoLaunch1^">
&<AREA COORDS=^"21^,160^,321^,222^" HREF=^"exit:?DemoLaunch2^">
&<AREA COORDS=^"19^,234^,321^,330^" HREF=^"exit:?DemoLaunch3^">
&<AREA COORDS=^"14^,340^,328^,384^" HREF=^"exit:?DemoLaunch4^">
&</MAP><p></body>
dohtml 1,Crack-It Demo Page,@x,DemoKill
:DemoLaunch1
gosub shPhrase
execute DEMOS\MECHWAR\start.exe,,DEMOS\MECHWAR
goto DemoRedisplay
:DemoLaunch2
gosub shPhrase
execute DEMOS\AW3Demo.EXE
goto DemoRedisplay
:DemoLaunch3
gosub shPhrase
LOADSCRIPT demos\f22.scp,,ReturnLabel
:ReturnLabel
goto DemoRedisplay
:DemoLaunch4
gosub shPhrase
execute DEMOS\dx5eng.exe
goto DemoRedisplay
:DemoKill
gosub shPhrase
gosub Quitter
goto DemoReDisplay
**
*Display the Selection page
*
:SelectionDisplay
clear cshcHTML,GameSearchString
*Re-display the page with any data from the previous display.
:SelectionRedisplay
concat x,
&<body background="art\bkgnd.gif">,
&<a href="exit:?SelectionBackClick">Go back</a><br><br>,
&<center><img src=^"art\alphabet.gif^" usemap=^"#alphamap^"></center>,
&<MAP NAME=^"alphamap">
&<AREA COORDS=^"1^,0^,44^,45^" HREF=^"exit:GameSearchString=A?SelectionAlpha^">
&<AREA COORDS=^"48^,3^,89^,45^" HREF=^"exit:GameSearchString=B?SelectionAlpha^">
&<AREA COORDS=^"96^,5^,136^,45^" HREF=^"exit:GameSearchString=C?SelectionAlpha^">
&<AREA COORDS=^"143^,2^,184^,45^" HREF=^"exit:GameSearchString=D?SelectionAlpha^">
&<AREA COORDS=^"190^,4^,229^,45^" HREF=^"exit:GameSearchString=E?SelectionAlpha^">
&<AREA COORDS=^"234^,4^,275^,46^" HREF=^"exit:GameSearchString=F?SelectionAlpha^">
&<AREA COORDS=^"281^,5^,320^,47^" HREF=^"exit:GameSearchString=G?SelectionAlpha^">
&<AREA COORDS=^"327^,4^,365^,46^" HREF=^"exit:GameSearchString=H?SelectionAlpha^">
&<AREA COORDS=^"373^,4^,413^,45^" HREF=^"exit:GameSearchString=I?SelectionAlpha^">
&<AREA COORDS=^"420^,4^,458^,45^" HREF=^"exit:GameSearchString=J?SelectionAlpha^">
&<AREA COORDS=^"466^,5^,505^,46^" HREF=^"exit:GameSearchString=K?SelectionAlpha^">
&<AREA COORDS=^"511^,4^,551^,46^" HREF=^"exit:GameSearchString=L?SelectionAlpha^">
&<AREA COORDS=^"559^,4^,597^,45^" HREF=^"exit:GameSearchString=M?SelectionAlpha^">
&<AREA COORDS=^"5^,50^,45^,93^" HREF=^"exit:GameSearchString=N?SelectionAlpha^">
&<AREA COORDS=^"51^,50^,91^,93^" HREF=^"exit:GameSearchString=O?SelectionAlpha^">
&<AREA COORDS=^"97^,50^,137^,92^" HREF=^"exit:GameSearchString=P?SelectionAlpha^">
&<AREA COORDS=^"143^,50^,183^,92^" HREF=^"exit:GameSearchString=Q?SelectionAlpha^">
&<AREA COORDS=^"190^,51^,229^,93^" HREF=^"exit:GameSearchString=R?SelectionAlpha^">
&<AREA COORDS=^"236^,50^,275^,91^" HREF=^"exit:GameSearchString=S?SelectionAlpha^">
&<AREA COORDS=^"283^,51^,321^,93^" HREF=^"exit:GameSearchString=T?SelectionAlpha^">
&<AREA COORDS=^"327^,51^,366^,93^" HREF=^"exit:GameSearchString=U?SelectionAlpha^">
&<AREA COORDS=^"373^,51^,412^,93^" HREF=^"exit:GameSearchString=V?SelectionAlpha^">
&<AREA COORDS=^"420^,51^,459^,92^" HREF=^"exit:GameSearchString=W?SelectionAlpha^">
&<AREA COORDS=^"466^,53^,505^,94^" HREF=^"exit:GameSearchString=X?SelectionAlpha^">
&<AREA COORDS=^"512^,52^,551^,93^" HREF=^"exit:GameSearchString=Y?SelectionAlpha^">
&<AREA COORDS=^"557^,52^,596^,92^" HREF=^"exit:GameSearchString=Z?SelectionAlpha^">
&</MAP>,
&"<br><B><center>Click on a letter, or enter a keyword and click SEARCH.</b></center>",
&"<br><center><FORM method=GET>",
&<INPUT NAME=GameSearchString size=30 maxlength=50 VALUE=",@GameSearchString,
&^"> <INPUT TYPE=submit value=Search Name=^"exit:?SelectionKeyword^"></FORM></center>,
&@cshcHTML, </body>
gosub shTheme
dohtml 1,Crack-It Game Selection Page,@x,SelectionKill
:SelectionBackClick
gosub shPhrase
goto WelcomeDisplay
*This exit assumes that a keyword has been chosen.
:SelectionKeyword
*First eliminate a zero-length string
convert GameSearchString,trim
set y,len @GameSearchString
if @y eq 0
signpost display,Blank Keyword.,
&<p><center>No keyword was indicated. <p>Please try again.</center>,40%,12%,20
goto SelectionDisplay
endif
*Next deal with too short a keyword.
if @y lt 3
signpost display,Keyword should be more specific.,
&<p><center>This selection is likely to generate far too many entries.
&<p>Please be more specific.</center>,40%,20%,30
goto SelectionReDisplay
endif
*Next deal with multiple keywords
instring x,@GameSearchString," ",1
if @x gt 0
signpost display,Multiple Keywords.,
&<p><center>More than one keyword was entered.
&<p>Please use a single keyword.</center>,40%,20%,30
goto SelectionReDisplay
endif
*Validation complete. Call the search engine.
gosub CreateSelectionHTMLCode
goto Selection1
*Handle Alpha Selections
:SelectionAlpha
*if the file is not ready, call the search engine, else load from the file.
concat y,search\,@GameSearchString,.txt
findfile x,@y
if @x eq ""
gosub CreateAlphaSelectionHTMLCode
else
readfile cshcHTML,@y
endif
clear GameSearchString
:Selection1
if @cshcHTML eq ""
signpost display,No matches found.,
&"<p><center>Sorry, but no matches were found.<p> Please try again.</center>",40%,10%,30
else
concat cshcHTML, "<table> <caption> Search Results: </caption>",@cshcHTML, "</table>"
endif
goto SelectionRedisplay
:SelectionKill
gosub shPhrase
gosub Quitter
goto SelectionReDisplay
:SelectionMade
**
*Display of the Content page
*
:ContentDisplay
gosub CreateContentHTMLCode
:ContentReDisplay
gosub shTheme
concat x,
&<body background=art\bkgnd.gif>,
&<a href=^"exit:?SelectionReDisplay^">Go back</a><br><br>,
&"<center><bold><big><big>Content Page for ",@cchcGN,</center></bold></big></big>,
&<br><br><table> <caption>Material Available</caption><br>,
&@cchcHTML, </table></body>
dohtml 1,Crack-It Content Page,@x,ContentKill
:ContentKill
gosub shPhrase
gosub Quitter
goto ContentReDisplay
:ContentItemClick
gosub shPhrase
*Decode the ActionData variable. Format: <action>;<path>;<scale>;<filename>;<description>
extract x,1,@ActionData
extract ItemPath,2,@ActionData
extract ItemScale,3,@ActionData
extract ItemFN,4,@ActionData
extract ItemDesc,5,@ActionData
if @x eq "Install" goto InstallItem
**
*Display of the ReadItem page
*
:ReadItemDisplay
:ReadItemReDisplay
gosub shTheme
concat x,@ItemPath,\,@ItemFN
readfile ItemFile,@x
if @$status ne "TRUE"
Scream File not found..,@x
halt
endif
*Handle scaling.
if @ItemScale eq 0
set ScaleHTML,"<font SIZE="3">"
else
if @$Screenwidth eq 640
if @Itemscale gt MAX640NOSCALE set ScaleHTML,"<font SIZE="-1">"
else
if @Itemscale gt MAX800NOSCALE set ScaleHTML,"<font SIZE="-1">"
endif
endif
concat y,"Crack-It Item Page for ",@ItemFN
concat x,
&<body background=art\bkgnd.gif>
&<a href=^"exit:?ContentReDisplay^">Go back</a>," ",
&<a href="exit:?ReadItemPrintPage">Print Page</a><br><br>
&<PRE>,
&@ItemFile,
&</FONT></PRE></body>
dohtml 1,@y,@x,ReadItemKill
goto ContentReDisplay
:ReadItemPrintPage
gosub shPhrase
gosub PrintPAge
goto ReadItemReDisplay
:ReadItemKill
gosub shPhrase
goto ContentReDisplay
**
*Install the item.
*
*This either runs an executable file, warns about a ZIP file,
*or else runs an SA script with the same first name
*which will take care of the installation.
*
:InstallItem
set fncFN,@ItemFN
gosub FileNameCracker
convert fncName,Uppercase
concat x,@ItemPath,\,@fncName,.SCP
findfile x,@x
if @x ne "" goto InstallItemViaScript
if @fncExt ne "ZIP" goto InstallItemDirectly
*Handle Zips.
:InstallItemViaZIP
concat x,
&"<center><bold><big>Compressed utility: ",@ItemFN,</center></bold></big>
&<p><p><p>The utility ^",@ItemFN,^" is a compressed (ZIP) file.
&<p>It can be found on the Crackit CD-ROM in at ^",@Itempath,\,@ItemFN,^".,"
&<p>If you wish to use this file, please move it over to a temporary
& directory on your hard drive, and then uncompress it with a ZIP utility.
&<p>If these instructions do not make sense to you, you should consult
& an experienced computer user before using this utility."
signpost Ok,"Zip file!",@x,400,350
goto ContentReDisplay
*InstallAgent script file found. Execute it. Return to Content page when completed
:InstallItemViaScript
gosub shPhrase
loadscript @x,,InstallItemReturn
:InstallItemViaScriptReturn
goto ContentReDisplay
*Run the File directly
:installitemreturn
goto ContentReDisplay
:InstallItemDirectly
gosub shPhrase
concat y,@Itempath,\
findfile y,@y
if @y ne ""
concat x,@y,@ItemFN
execute @x,,@y
endif
goto ContentReDisplay
****** subroutines *********
**
*Sub Quitter - Checks if the user wants to kill the script.
*
:Quitter
concat x,<br><center>Do you want really want to exit the program?</center>
signpost yesno,Exit Program?,@x,224,144
if @$status eq YES halt
return
**
*Sub PrintPage - Prints the current HTML Window. Often caled from HTML
*
:PrintPage
PrintHTML 1
return
**
*Sub Quitter - Checks if the user wants to kill the script.
*
**
*Sub FileNameCracker - Breaks a file name into its components. Partially implemented
*
*Entry: fncFN is the filepath to be cracked.
*
*Exit: fncStatus = TRUE if the operation worked. FALSE if it failed.
* fncExt = the extension part of the item. "" if there was none.
* fncName = the name part of the item.
* fncPath = the path part of the item. (NYI)
*
:FileNameCracker
*Locate extension and extract it.
set fncStatus,FALSE
clear fncExt
InString fncx, @fncFN,"."
if @fncx ne 0
set fncx, @fncx + 1
substring fncExt,@fncFN,@fncx,99
convert fncExt,Trim
endif
*Extract the file name
if @fncx eq 0
set fncName,@fncFN
else
set fncx,@fncx - 2
substring fncName,@fncFN,1,@fncx
convert fncName,Trim
endif
*Clean up
set fncStatus,TRUE
clear fncPath
return
**
*(CSHC) CreateSelectionHTMLCode - create the SelectionHTMLCode string based
*upon the results of a search of MainList.sl game titles.
*
*The fragment created is a table of many lines, one for each game found.
*If an entry is clicked, it exits HTML, setting variable ContentData to an slist
*containing the Game name and subdirectory name for the content item selected.
*
*Entry: CreateSelectionHTMLCode: GameSearchString contains the data from the Selection form.
* CreateAlphaSelectionHTMLCode: GameSearchString contains the single character from
* the Alphabetic search graphic.
*
* Mainlist.sl format: <Game Name>; <Game Material Codes>; <Subdirectory>
*
*Exit: Returns to Parent script.
* cshcHTML contains the HTML fragment to be included in the selection page.
* cshcSLCount is the count of entries found.
*
**
*Variables:
*
* cshcIndex Index for the MainList slist.
* cshcGN Game Name, extracted from MainList.
* cshcGMC Game Material Codes for this entry.
* cshcSub Game subdirectory.
* cshcSL A (shortlist) slist of the indexes of elements of MainList which match GameSearchString
* cshcSLIndex Index for cshcSL
* cshcSLCount Number of entries found.
* cshcX Scratch.
* cshcY Scratch.
* cshcZ Scratch.
* cshcHTML Output HTML fragment.
*
**
*Alternate Entry - CreateSelectionHTMLCode. Extract keyword matches into a short list.
*
:CreateSelectionHTMLCode
search cshcSL, @MainList, @GameSearchString, 3, 1
goto cshcInitialize
**
*Alternate entry - CreateAlphaSelectionHTMLCode. Extract alphabet matches into a short list.
*
:CreateAlphaSelectionHTMLCode
search cshcSL, @MainList, @GameSearchString, 3, 1, Startwith
goto cshcInitialize
*Initialize.
:cshcInitialize
clear cshcIndex,cshcGN,cshcIT,cshcGMC,cshcSub,cshcX,cshcY,cshcZ,cshcHTML
set cshcSLIndex,0
*Extraction and processing loop.
set cshcSLCount, count @cshcSL
:cshcExtractLine
set cshcSLIndex, @cshcSLIndex + 1
if @cshcSLIndex gt @cshcSLCount goto cshcExit
*Extract the items indicated in the Short List.
:cshcGenerateHTML
extract cshcIndex,@cshcSLIndex,@cshcSL
extract cshcGN,@cshcIndex,@Mainlist
set cshcIndex,@cshcIndex + 1
extract cshcGMC,@cshcIndex,@MainList
convert cshcGMC,Uppercase
set cshcIndex,@cshcIndex + 1
extract cshcSub,@cshcIndex,@MainList
set cshcIndex,@cshcIndex + 1
*Put up the progress display.
set cshcX, @cshcSLIndex / @cshcSLCount
set cshcY,len @cshcHTML
progress Open,Scanning.,"Scanning... ",@cshcGN,@cshcX
*Expand cshcGMC into long hand in cshcX.
clear cshcX
instring cshcZ, @cshcGMC, "C"
if @cshcZ gt 0 concat cshcX, @cshcX, "Cheats "
instring cshcZ, @cshcGMC, "U"
if @cshcZ gt 0 concat cshcX, @cshcX, "Utilities "
instring cshcZ, @cshcGMC, "T"
if @cshcZ gt 0 concat cshcX, @cshcX, "Tips & Tricks "
instring cshcZ, @cshcGMC, "E"
if @cshcZ gt 0 concat cshcX, @cshcX, "Errors "
instring cshcZ, @cshcGMC, "W"
if @cshcZ gt 0 concat cshcX, @cshcX, "Walkthroughs "
*Concatenate a fragment of HTML code onto SelectionHTMLCode.
*Each frag is a table row for the entry found. If clicked, it sets ContentSub.
concat cshcHTML,@cshcHTML,
&<tr><td>,@cshcSLIndex,</td><td><a href=^"exit:ContentData=,
&@cshcGN,";",@cshcSub,?Selectionmade^">,
&@cshcGN,.</a></td><td>,@cshcX, </td></tr><br>
goto cshcExtractLine
*Clean up our toys and return.
:cshcExit
Progress Close
Release cshcIndex,cshcGN,cshcGMC,cshcX,cshcY,cshcZ,cshcSL,cshcSLIndex,cshcSub
Return
**
*(CCHC) CreateContentHTMLCode - create the ContentHTMLCode string based upon the slist found in CONTENT.SL
*
*Entry: ContentData contains an slist with Game Name;Subdirectory.
* Content.sl is a file containing the contents slist we are to use.
*
*Content.sl file format:
* Row 1: Comment
* Row 2..N <Entry file Name>;<Entry Description>;<Entry Mat Codes>;<Entry Action>;
*
*Exit: cchcGN contains the game name.
* cchcHTML contains the HTML fragment of table entries to be included in the Content page.
*
* clicking an entry generates ActionData as an slist: <action>;<path>;<filename>;<description>
*
**
*Variables:
*
* ContentData String containing subdirectory name of the content area.
* cchcPath String containing the expanded file path of the content area.
* cchcIndex Index to the cchcContentSlist
* cchcContentList Slist contains the contents for this subdirectory.
* cchcListCount Number of segments in the slist
* cchcHTML String contains the assembled HTML code fragment.
* cchcED Entry Description (longhande description)
* cchcEFN Entry File Name
* cchcEMC Entry Material Codes
* cchcEAC Entry Action
* cchcGN Contains the game name
* cchcScale Contains the scaling width of the text file
* cchcX Scratch
* cchcY Scratch
* cchcZ Scratch
:CreateContentHTMLCode
Clear cchcHTML
*Crack the ContentData
extract cchcGN,1,@ContentData
extract cchcPath,2,@ContentData
*Get the slist from the indicated directory.
convert cchcPath,trim
concat cchcPath,Content\,@cchcPath
concat cchcX,@cchcPath,\content.sl
readfile cchcContentList,@cchcX,slist
if @$status eq "NF"
scream "Content file not found ",@cchcX
halt
endif
*extract each record into local variables before generating HTML.
set cchcIndex,2
set cchcListCount, count @cchcContentList
:cchcExtractLine
if @cchcIndex gt @cchcListCount goto cchcExit
*Handle width-scaling prefix on the file name
extract cchcEFN,@cchcIndex,@cchcContentList
substring cchcX,@cchcEFN,1,1
if @cchcX eq "*"
instring cchcX,@cchcEFN,"*",2
set cchcX,@cchcX - 1
substring cchcScale,@cchcEFN,2,@cchcX
set cchcX,@cchcX + 2
substring cchcEFN,@cchcEFN,@cchcX,99
else
set cchcScale,0
endif
convert cchcEFN,uppercase
set cchcIndex,@cchcIndex + 1
extract cchcED,@cchcIndex,@cchcContentList
set cchcIndex,@cchcIndex + 1
extract cchcEMC,@cchcIndex,@cchcContentList
convert cchcEMC,uppercase
set cchcIndex,@cchcIndex + 1
extract cchcEAC,@cchcIndex,@cchcContentList
convert cchcEAC,uppercase
set cchcIndex,@cchcIndex + 1
*Expand cchcEMC into long hand.
if @cchcEMC eq "C" set cchcEMC, "Cheats Codes"
if @cchcEMC eq "U" set cchcEMC, "Utility"
if @cchcEMC eq "T" set cchcEMC, "Tips & Tricks"
if @cchcEMC eq "E" set cchcEMC, "Errors"
if @cchcEMC eq "W" set cchcEMC, "Walkthrough"
*Expand cchcEAC into long hand.
if @cchcEAC eq "D" set cchcEAC, "Read"
if @cchcEAC eq "I" set cchcEAC, "Install"
*Generate the HTML fragment.
concat cchcHTML,@cchcHTML,
&<tr>
&<td><a href=^"exit:ActionData=,@cchcEAC,;,@cchcPath,;,@cchcScale,;,@cchcEFN,;,@cchcED,?ContentItemClick^">,
& @cchcEAC, </a></td>
&<td>,@cchcEFN,.</td>
&<td>,@cchcED, </td>
&<td>,@cchcEMC, </td>
&</tr><br>
goto cchcExtractLine
*Clean up our toys and return.
:cchcExit
Release cchcIndex,cchcContentList,cchcListCount
Release cchcEFN,cchcEMC,cchcEAC,cchcED,cchcX,cchcZ,cchcPath,cchcScale
return
Debug all
gosub shInitTheme
:loop
gosub shTheme
goto loop
**
*Sub SoundHandler. (sh) Handles theme music and phrases; it allows a theme to
*be interrupted by a phrase, but waits for a phrase to end before playing a theme.
*
*Entry shInitTheme Initializes the theme system.
*Entry shTheme Just call it, it takes care of themes.
*Entry shInitPhrase Initializes the phrase system.
*Entry shPhrase Just call it, it takes care of phrase.
*
*Option: shThemeEnable can be set to FALSE to disable the Theme unit.
* shPhraseEnable can be set to FALSE to disable the Phrase unit.
*
*Entry shInitTheme: Initialize the theme files by putting them into an slist.
:shInitTheme
findfile shThemeList,sound\themes\*.wav
set shThemeListCount, count @shThemeList
set shThemeEnable,TRUE
return
*Entry shTheme: Play the next WAV sound file in the theme listlist.
:shTheme
if @shThemeEnable ne TRUE return
player 2,CHECK
if @$STATUS eq PLAY goto shTHEME
player 1,CHECK
if @$STATUS eq PLAY return
set shThemeListIndex, random @shThemeListCount
extract shThemeFile,@shThemelistIndex,@shThemeList
player 1,STOP,WAV,@shThemeFile
player 1,PLAY
return
*Entry shInitPhrase: Initialize the phrase files by putting them into an slist.
:shInitPhrase
findfile shPhraseList,sound\phrases\*.wav
set shPhraseListCount, count @shPhraseList
set shPhraseEnable,TRUE
return
*Entry shPhrase: Play the next WAV sound file in the Phrase listlist.
:shPhrase
if @shPhraseEnable ne TRUE return
set shPhraseListIndex, random @shPhraseListCount
extract shPhraseFile,@shPhraselistIndex,@shPhraseList
player 2,STOP,WAV,@shPhraseFile
player 2,PLAY
return